import com.mars.dao.Hello;
import com.mars.service.UserServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.web.context.support.XmlWebApplicationContext;

public class Mytest {

    public static void main(String[] args) {

        ApplicationContext ac = new ClassPathXmlApplicationContext("beans.xml");
        UserServiceImpl userServiceImpl = (UserServiceImpl) ac.getBean("UserServiceImpl");
        userServiceImpl.getUser();

    }

    @Test
    public void test(){
        ApplicationContext ac = new ClassPathXmlApplicationContext("beans.xml");
        Hello hello = ac.getBean("hello3", Hello.class);
        Hello hello1 = ac.getBean("hello4", Hello.class);
        System.out.println(hello==hello1);
    }


}
